home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -in_the_mag- / reader_requests / xgtool / xgtoolset / source / bars.h next >
C/C++ Source or Header  |  2000-02-23  |  35KB  |  740 lines

  1. /*      Bars.h
  2.  
  3.     © 1989,1991 The Blue Ribbon SoundWorks, Ltd.
  4.  
  5.     Header file for Bars&Pipes Professional Tools and Accessories
  6. */
  7.  
  8. #define MIDI_NOTEOFF    0x80
  9. #define MIDI_NOTEON     0x90
  10. #define MIDI_PTOUCH     0xA0
  11. #define MIDI_CCHANGE    0xB0
  12. #define MIDI_PCHANGE    0xC0
  13. #define MIDI_MTOUCH     0xD0
  14. #define MIDI_PBEND      0xE0
  15. #define MIDI_SYSX       0xF0
  16. #define MIDI_MTC        0xF1
  17. #define MIDI_SONGPP     0xF2
  18. #define MIDI_SONGS      0xF3
  19. #define MIDI_EOX        0xF7
  20. #define MIDI_CLOCK      0xF8
  21. #define MIDI_START      0xFA
  22. #define MIDI_CONTINUE   0xFB
  23. #define MIDI_STOP       0xFC
  24. #define MIDI_SENSE      0xFE
  25.  
  26. #define EVENT_ONTIME    0x10            /* This event is an on-time event. */
  27. #define EVENT_BRANCH    0x20            /* This event is traversing a branch. */
  28. #define EVENT_PADEDIT   0x40            /* Not a real time event. */
  29. #define EVENT_PLAYONLY  0x80            /* Discard event when recording. */
  30. #define EVENT_VOICE     1               /* Performance event */
  31. #define EVENT_SYSX      2               /* System exclusive event. */
  32. #define EVENT_LYRIC     3               /* Lyric string. */
  33. #define EVENT_TIMESIG   4               /* Time signature change event. */
  34. #define EVENT_KEY       5               /* Key change event. */
  35. #define EVENT_CHORD     6               /* Chord change event. */
  36. #define EVENT_RHYTHM    7               /* Rhythm template event. */
  37. #define EVENT_DYNAMICS  8               /* Dynamics event. */
  38.  
  39.  
  40. struct Event {
  41.     struct Event *next;                 /* The next event in the list. */
  42.     long time;                          /* When this event occurs. */
  43.     char type;                          /* What type of event. */
  44.     unsigned char status;               /* MIDI status. */
  45.     unsigned char byte1;                /* First byte of data. */
  46.     unsigned char byte2;                /* Second byte of data. */
  47.     long data;                          /* Data storage. */
  48.     struct Tool *tool;                  /* Tool that processes this next. */
  49. };
  50.  
  51. struct EventList {
  52.     struct Event *first;                /* First in list. */
  53.     struct Event *point;                /* Current position in list. */
  54. };
  55.  
  56.  
  57. struct NoteEvent {
  58.     struct NoteEvent *next;             /* The next event in the list. */
  59.     long time;                          /* When this event occurs. */
  60.     char type;                          /* What type of event. */
  61.     unsigned char status;               /* MIDI status. */
  62.     unsigned char value;                /* Note value. */
  63.     unsigned char velocity;             /* Note velocity. */
  64.     unsigned short duration;            /* The duration of this event. */
  65.     short data;                         /* Data storage. */
  66.     struct Tool *tool;                  /* Tool that processes this next. */
  67. };
  68.  
  69. struct String {
  70.     unsigned short length;              /* The length of the string that follows. */
  71.     char string[1];                     /* This is actually a variable length array. */
  72. };
  73.  
  74. struct StringEvent {
  75.     struct StringEvent *next;           /* The next event in the list. */
  76.     long time;                          /* When this event occurs. */
  77.     char type;                          /* What type of event. */
  78.     unsigned char status;               /* For SysEx. */
  79.     short length;                       /* Display length. */
  80.     struct String *string;              /* Pointer to string. */
  81.     struct Tool *tool;                  /* Tool that processes this next. */
  82. };
  83.  
  84. struct SysEx {
  85.     unsigned long length;               /* The length of the packet. */
  86.     struct Task *task;                  /* Sending task, for signaling. */
  87.     short signal;                       /* Signal number. */
  88.     char done;                          /* Done flag. */
  89.     char *data;                         /* The data. */
  90. };
  91.  
  92. struct SysExEvent {
  93.     struct SysExEvent *next;            /* The next event in the list. */
  94.     long time;                          /* When this event occurs. */
  95.     char type;                          /* What type of event. */
  96.     unsigned char status;               /* For SysEx. */
  97.     short length;                       /* Display length. */
  98.     struct SysEx *sysex;               /* Pointer to data. */
  99.     struct Tool *tool;                  /* Tool that processes this next. */
  100. };
  101.  
  102. struct Chord {
  103.     struct Chord *next;                 /* Next in list. */
  104.     struct String *name;                /* Chord name. */
  105.     unsigned long pattern;              /* Bit pattern of chord. */
  106.     unsigned short id;                  /* Chord identifier. */
  107.     char count;                         /* Number of notes in chord. */
  108. };
  109.  
  110. struct ChordEvent {
  111.     struct ChordEvent *next;            /* The next event in the list. */
  112.     long time;                          /* When this event occurs. */
  113.     char type;                          /* What type of event. */
  114.     unsigned char root;                 /* Root note. */
  115.     char flats;                         /* Chord root is a flat. */
  116.     char pad;
  117.     unsigned long chordid;              /* Chord id. */
  118.     struct Chord *chord;                /* Chord. */
  119. };
  120.  
  121. struct KeyEvent {
  122.     struct KeyEvent *next;              /* The next event in the list. */
  123.     long time;                          /* When this event occurs. */
  124.     char type;                          /* What type of event. */
  125.     unsigned char root;                 /* Root note. */
  126.     char flats;                         /* Display the key with flats. */
  127.     char pad;
  128.     unsigned long scaleid;              /* Scale id. */
  129.     struct Chord *scale;                /* Pointer to Scale definition. */
  130. };
  131.  
  132.  
  133. struct TimeSigEvent {
  134.     struct TimeSigEvent *next;          /* The next event in the list. */
  135.     long time;                          /* When this event occurs. */
  136.     char type;                          /* What type of event. */
  137.     unsigned char beatcount;            /* Number of beats per measure. */
  138.     unsigned char beat;                 /* What note gets beat. */
  139.     char pad;
  140.     unsigned short clocks;              /* Clocks per beat. */
  141.     unsigned short measures;            /* Measures till next. */
  142.     unsigned long totalclocks;          /* Clocks till next. */
  143. };
  144.  
  145. struct TimeSigList {
  146.     struct TimeSigEvent *first;         /* First in list. */
  147.     struct TimeSigEvent *point;         /* Current position in list. */
  148.     unsigned short measure;             /* Current measure. */
  149.     unsigned short beat;                /* Current beat. */
  150.     unsigned short clock;               /* Current clock. */
  151. };
  152.  
  153. struct Rhythm {
  154.     struct Rhythm *next;                /* Next in list of templates. */
  155.     struct String *name;                /* Name of this rhythm. */
  156.     struct NoteEvent *notes;            /* List of notes. */
  157.     long length;                        /* Loop length. */
  158.     short id;                           /* Identifier. */
  159. };
  160.  
  161. struct RhythmEvent {
  162.     struct RhythmEvent *next;           /* The next event in the list. */
  163.     long time;                          /* When this event occurs. */
  164.     char type;                          /* What type of event. */
  165.     char pad;                           /* Empty. */
  166.     unsigned short rhythmid;            /* Id of rhythm clip. */
  167.     struct Rhythm *rhythm;              /* Rhythm. */
  168.     struct NoteEvent *point;            /* Current position in rhythm. */
  169. };
  170.  
  171. struct DynamicsEvent {
  172.     struct DynamicsEvent *next;         /* The next event in the list. */
  173.     long time;                          /* When this event occurs. */
  174.     char type;                          /* What type of event. */
  175.     unsigned char value;                /* Dynamic value. */
  176.     unsigned char lastvalue;            /* Previous dynamic value. */
  177.     unsigned char nextvalue;            /* Next Dynamic value. */
  178.     long lasttime;                      /* Previous time. */
  179.     long nexttime;                      /* Next time. */
  180. };
  181.  
  182.  
  183. struct Clip {
  184.     struct Clip *next;                  /* List of clips. */
  185.     struct EventList events;            /* Event list. */
  186.     struct EventList chords;            /* List of bass chords. */
  187.     struct EventList keys;              /* List of keys. */
  188.     struct EventList lyrics;            /* List of lyrics. */
  189.     struct EventList rhythm;            /* List of rhythm templates. */
  190.     struct EventList dynamics;          /* List of dynamic changes. */
  191.     struct TimeSigList timesig;         /* List of time signatures. */
  192.     struct String *name;                /* Name of this clip. */
  193.     struct String *notes;               /* Notes for this clip. */
  194.     long begin;                         /* Time this begins. */
  195.     long end;                           /* Time this ends. */
  196.     unsigned char highnote;             /* Highest note, for display. */
  197.     unsigned char lownote;              /* Lowest note, for display. */
  198.     char locked;                        /* Locked during record. */
  199. };
  200.  
  201. /*      For handling a linked list of clips in parallel: */
  202.  
  203. struct ClipList {
  204.     struct ClipList *next;              /* Next Clip or ClipList. */
  205.     long cliplisttag;                   /* Tag to identify ClipList. */
  206.     struct Clip *cliplist;              /* List of clips. */
  207. };
  208.  
  209.  
  210. struct Tool {
  211.     struct Tool *next;                  /* Next tool used by this track. */
  212.     struct Tool *branch;                /* Tool on other track. */
  213.     struct Tool *parent;                /* Parent tool (for macros.) */
  214.     struct ToolMaster *toolmaster;      /* Pointer to actual tool. */
  215.     struct Clip *clip;                  /* Clip to be worked on. */
  216.     struct String *name;                /* Name of this tool. */
  217.     struct Window *window;              /* Edit window. */
  218.     struct Track *track;                /* Track that owns this tool. */
  219.     long toolid;                        /* Tool ID. */
  220.     unsigned short left,top;            /* Position of edit window. */
  221.     unsigned short width,height;        /* Size of edit window. */
  222.     unsigned short x,y;                 /* Position in pipe display. */
  223.     unsigned short xindex;              /* How far down list this is. */
  224.     unsigned short yindex;              /* How far down track list this is. */
  225.     short branchindex;                  /* How far away branch tool is. */
  226.     unsigned short id;                  /* ID for file io. */
  227.     char intool;                        /* True if inlist, false if outlist. */
  228.     char inedit;                        /* Flag to indicate editing now. */
  229.     char touched;                       /* This tool has been edited. */
  230.     char selected;                      /* Icon selected in graph. */
  231.     long tooltype;                      /* Sequence? Input? Branch? */
  232.                     /* More tool unique stuff here... */
  233. };
  234.  
  235. #define TOUCH_EDIT              1       /* Tool has been edited. */
  236. #define TOUCH_INIT              2       /* Tool has been initialised. */
  237.  
  238. #define TOOL_SEQUENCE           1       /* This is actually the track. */
  239. #define TOOL_INPUT              2       /* This is an input tool. */
  240. #define TOOL_OUTPUT             4       /* This is an output tool. */
  241. #define TOOL_NORMAL             8       /* This is a normal tool. */
  242. #define TOOL_ONTIME             0x10    /* This tool doesn't accept early events. */
  243. #define TOOL_BRANCHIN           0x20    /* This tool merges two inputs. */
  244. #define TOOL_BRANCHOUT          0x40    /* This tool has two outputs. */
  245. #define TOOL_MACRO              0x80    /* This tool is a macro tool. */
  246. #define TOOL_MACROOUT           0x100   /* This is the output of macro. */
  247. #define TOOL_MACROBRANCH        0x200   /* This is the branch output of macro. */
  248. #define TOOL_MACROIN            0x400   /* This is the input of macro. */
  249. #define TOOL_GROUPIN            0x800   /* This tool part of group input. */
  250. #define TOOL_MIDI               0x1000  /* This tool is MIDI capable. */
  251. #define TOOL_NOTPAD             0x2000  /* This can not go in the toolpad. */
  252. #define TOOL_STOOL              0x4000  /* This is a sequencer tool. */
  253. #define TOOL_NOTPIPE            0x8000  /* This tool can not go in pipeline. */
  254.  
  255. struct ToolMaster {
  256.     struct ToolMaster *next;            /* Next tool in this list. */
  257.     long toolid;                        /* Tool ID. */
  258.     struct Image *image;                /* Icon for this tool. */
  259.     struct Image *upimage;              /* Icon for branching up. */
  260.     short x,y;                          /* Position in toolbox for display. */
  261.     char name[100];                     /* Tool name. */
  262.     char filename[100];                 /* Where it is stored on disk. */
  263.     struct Tool *(*createtool)();       /* Routine to allocate a new tool. */
  264.     void (*edittool)();                 /* Routine to edit tool parameters. */
  265.     struct Event *(*processevent)();    /* Routine to process an event. */
  266.     struct Event *(*processlist)();     /* Routine to process a list of events. */
  267.     void (*deletetool)();               /* Routine to delete a tool. */
  268.     void (*removetool)();               /* Routine to close down. */
  269.     long (*savesize)();                 /* Returns size prior to save. */
  270.     long (*savetool)();                 /* Routine to save to disk. */
  271.     struct Tool *(*loadtool)();         /* Routine to load from disk. */
  272.     void (*readsysex)();                /* Pass sysex byte */
  273.     long (*expandb)();                  /* Clear environment */
  274.     long (*expandc)();                  /* Install environment */
  275.     long segment;                       /* This tool's segment list. */
  276.     long altsegment;                    /* For later.. */
  277.     struct Track *intrack;              /* Input track for this tool. */
  278.     short toolsize;                     /* Tool size for loading and saving. */
  279.     char inedit;                        /* Flag to indicate editing now. */
  280.     char selected;                      /* Icon selected in graph. */
  281.     long tooltype;                      /* Type of tool. */
  282. };
  283.  
  284. struct Track {
  285.     struct Track *next;                 /* Next Track in the list. */
  286.     struct Edit *edit;                  /* Edit structure for this track. */
  287.     struct Clip clip;                   /* A clip that defines the sequence. */
  288.     struct Clip cut;                    /* A clip for global editing. */
  289.     struct Clip undo;                   /* A clip for undo command. */
  290.     struct EventList record;            /* Event list for recording. */
  291.     struct Tool *toollist;              /* List of tools. */
  292.     struct Tool tool;                   /* Sequence tool. */
  293.     struct Tool *point;                 /* For making display. */
  294.     unsigned char channelin;            /* MIDI Channel coming in. */
  295.     unsigned char channelout;           /* MIDI Channel going out. */
  296.     unsigned char mode;                 /* Mute | Through | Record. */
  297.     unsigned char selected;             /* Track is highlighted. */
  298.     long group;                         /* Group bits. */
  299.     unsigned long marks[20];            /* For figuring out display. */
  300.     short markindex;                    /* Farthest right bit in marks. */
  301.     short height;                       /* Height in display. */
  302.     short nameleft;                     /* Left edge of name. */
  303.     short namewidth;                    /* Width of name field. */
  304.     short nameindent;                   /* Indentation into name field. */
  305.     short channelinleft;                /* Left edge of channel in. */
  306.     short toolsinleft;                  /* Left edge of toolsin. */
  307.     short toolsinwidth;                 /* Width of toolsin field. */
  308.     short toolsinindent;                /* Indentation into toolsin field. */
  309.     short playrecordleft;               /* Left edge of play/record. */
  310.     short sequenceleft;                 /* Left edge of sequence. */
  311.     short sequencewidth;                /* Width of sequence field. */
  312.     long sequenceindent;                /* Indentation into sequence field. */
  313.     short muteleft;                     /* Left edge of mute/through. */
  314.     short toolsoutleft;                 /* Left edge of toolsout. */
  315.     short toolsoutwidth;                /* Width of toolsout field. */
  316.     short toolsoutindent;               /* Indentation into toolsout field. */
  317.     short toolsouttotalwidth;           /* Total width of tools out. */
  318.     short channeloutleft;               /* Left edge of channel out. */
  319. };
  320.  
  321. #define TRACK_MUTE      1
  322. #define TRACK_THROUGH   2
  323. #define TRACK_RECORD    4
  324. #define TRACK_SOLOMUTE  8               /* Track was muted for solo. */
  325. #define TRACK_INEDIT    16
  326. #define TRACK_REALTIME  32
  327. #define TRACK_MERGE     64              /* Merge while recording. */
  328.  
  329. #define TB_NOUNDO               1     /* This track has no undo buffer. */
  330. #define TB_PRINTEDIT            2     /* This track has a FALSE edit structure. */
  331. #define TB_STOOL                4     /* There's a sequence tool for this track. */
  332.  
  333. struct Accessory {
  334.     struct Accessory *next;             /* Next accessory in this list. */
  335.     long id;                            /* Accessory ID. */
  336.     struct Image *image;                /* Icon for this accessory. */
  337.     struct Image *onimage;              /* Icon for when selected. */
  338.     char name[100];                     /* Name. */
  339.     char filename[100];                 /* Where it is stored on disk. */
  340.     struct Window *window;
  341.     unsigned short left,top;            /* Position of edit window. */
  342.     unsigned short width,height;        /* Size of edit window. */
  343.     unsigned short x,y;                 /* Position in access box. */
  344.     long (*remove)();
  345.     long (*edit)();                     /* Routine to edit accessory. */
  346.     long (*open)();                     /* Routine to open it. */
  347.     long (*close)();
  348.     long (*size)();
  349.     long (*save)();
  350.     long (*load)();
  351.     long (*install)();                  /* Install in environment. */
  352.     long (*clear)();                    /* Clear from environment. */
  353.     long (*expandc)();                  /* Future routine? */
  354.     long segment;                       /* This accessory's segment list. */
  355.     long altsegment;                    /* Alternate segment list. */
  356.     char selected;                      /* Icon selected in graph. */
  357. };
  358.  
  359. #define TC_START        1
  360. #define TC_STOP         2
  361. #define TC_POSITION     3
  362. #define TC_RECORDON     4
  363. #define TC_RECORDOFF    5
  364. #define TC_PLAY         6
  365. #define TC_TICK         7
  366.  
  367. /*      There is a linked list of Tempo nodes.  Each specifies a clock cycle,
  368.     buffer size, and repeat count.  The last cycles forever.
  369. */
  370.  
  371. struct Tempo {
  372.     struct Tempo *next;                 /* Next Tempo in list. */
  373.     long time;                          /* Time, in clocks, this starts. */
  374.     unsigned short cycle;               /* Sample rate. */
  375.     unsigned short bpm;                 /* Beats per minute. */
  376.     long repeat;                        /* Repeat count. */
  377.     unsigned long frame;                /* Frame this starts on. */
  378. };
  379.  
  380. /*      For editing the Tempo, the user sets Tempo Changes. */
  381.  
  382. struct TempoChange {
  383.     struct TempoChange *next;
  384.     long time;                          /* When this occurs, in clicks. */
  385.     char eventtype;                     /* What type of event. */
  386.     char type;                          /* Type of change. */
  387.     short bpm;                          /* Beats per minute. */
  388.     long duration;                      /* How long the change should take. */
  389.     struct Tempo *tempos;               /* Pointer into list of tempos. */
  390. };
  391.  
  392. #define TC_INSTANT      1
  393. #define TC_LINEAR       2
  394. #define TC_EXPCURVE     3
  395. #define TC_LOGCURVE     4
  396.  
  397. struct SMPTE {
  398.     unsigned char hours, minutes, seconds, frames;
  399. };
  400.  
  401. struct Section {
  402.     struct Section *next;
  403.     long time;
  404.     char type;                          /* What type of event. */
  405.     char pattern;
  406.     char pad[2];
  407.     struct String *string;              /* Pointer to string. */
  408.     long length;                        /* Length of this section. */
  409. };
  410.  
  411. /*      Array of pointers to shared data, functions and library pointers,
  412.     so all tools can share these. */
  413. struct RastPort;
  414. struct Gadget;
  415. struct Functions {
  416.     char locked;
  417.     char measureres;                    /* Cuts resolve to measures. */
  418.     char recording;                     /* Set when recording. */
  419.     char running;                       /* Set when running. */
  420.     char punchenabled;                  /* Auto punch in and out enabled. */
  421.     char loopenabled;                   /* Loop mode turned on. */
  422.     char clicking;                      /* Click track on? */
  423.     char seeclick;                      /* Visual metronome. */
  424.     char multiin;                       /* Multiple inputs? */
  425.     char clickchannel;                  /* MIDI CLick channel. */
  426.     char midiclock;                     /* Sync to MIDI clocks. */
  427.     char smpteclock;                    /* Sync to SMPTE. */
  428.     char sendmidiclock;                 /* Send out MIDI clocks. */
  429.     char smptetype;                     /* Which SMPTE format. */
  430.     char countdown;                     /* Do count down. */
  431.     char midiclick;                     /* Use MIDI for click track. */
  432.     char chop;
  433.     long leadinstart;                   /* Length of lead in. */
  434.     long timenow;                       /* Current time. */
  435.     unsigned long markone;              /* Auto locate register. */
  436.     unsigned long marktwo;              /* Auto locate register. */
  437.     unsigned long punchin;              /* Punch in point. */
  438.     unsigned long punchout;             /* Punch out point. */
  439.     unsigned long loopin;               /* Loop in point. */
  440.     unsigned long loopout;              /* Loop out point. */
  441.     unsigned long cutin;                /* Cut in point. */
  442.     unsigned long cutout;               /* Cut out point. */
  443.     long starttime;                     /* Where to play from. */
  444.     long stoptime;                      /* Marker to stop at. */
  445.     unsigned long padcutin;             /* For non real time edits. */
  446.     unsigned long padcutout;            /* For non real time edits. */
  447.     unsigned long songlength;
  448.     long startoffset;                   /* Starting hi res clock offset. */
  449.     unsigned short tempos[4];
  450.     unsigned short tempo;               /* Current tempo. */
  451.     unsigned short inittempo;           /* Initial tempo. */
  452.     char songname[100];
  453.     char author[100];
  454.     short palette[8];                   /* Colors. */
  455.     char remotecontrol[128];            /* Table of remote controls. */
  456.     unsigned long markthree;            /* Auto locate register. */
  457.     unsigned long markfour;             /* Auto locate register. */
  458.     unsigned char volumenum;            /* Mix Maestro Volume CC. */
  459.     unsigned char pannum;               /* Mix Maestro Pan CC. */
  460.     unsigned char subdivide;            /* Metronome subdivision. */
  461.     char bypassmix;
  462.     long savestop;                      /* Place to save stop sign. */
  463.     long printflags;                    /* Print flags. */
  464.     long more[11];                      /* Expansion space. */
  465.     long songlist;                      /* For time-line stuff. */
  466.     unsigned long clockcycles;          /* Time in clock cycles! */
  467.     char useclip;                       /* Use the ClipBoard. */
  468.     char externclock;                   /* External clock flag. */
  469.     short timeroffset;                  /* For external clock. */
  470.     long coordlist;
  471.     struct Track *tracklist;            /* Top track in list. */
  472.     struct Clip masterclip;             /* Master key, chord, signature. */
  473.     struct Clip masterundo;
  474.     struct Clip mastercut;
  475.     struct Edit *masteredit;
  476.     struct Tool *edittools[16];         /* 16 Tools to edit with. */
  477.     unsigned short toolid;              /* Global tool id. */
  478.     short groupid;                      /* Currently selected group. */
  479.     struct Chord *scalelist;            /* All scales. */
  480.     struct Chord *chordlist;            /* All chords. */
  481.     struct Rhythm *rhythmlist;          /* All rhythms. */
  482.     struct Section *sectionlist;        /* ABA list. */
  483.     struct TempoChange *tempochangelist;/* Tempo Change list. */
  484.  
  485.     long whoops;                        /* Time line song list used to be here. */
  486.     unsigned long frame;                /* Current frame. */
  487.     unsigned long hirestime;            /* Hi res clock. */
  488.     char version;
  489.     long SysBase;                       /* Exec library. */
  490.     long DOSBase;                       /* DOS library. */
  491.     long IntuitionBase;
  492.     long GfxBase;
  493.     long LayersBase;
  494.     long standardout;                   /* Ignore. */
  495.     long pipequeue;                     /* Ignore. */
  496.     long earlyqueue;                    /* Ignore. */
  497.     struct Screen *screen;              /* Screen we all exist in. */
  498.     struct Window *window;              /* Main (backdrop) window. */
  499.     struct ToolMaster *toolmasterlist;  /* All ToolMasters. */
  500.     struct Accessory *accesslist;       /* All Accessories. */
  501.     struct Tool *midiouttool;           /* Tool to send MIDI clocks. */
  502.     long (*stealmidi)();                /* Steal serial interrupt. */
  503.     long (*releasemidi)();              /* Release MIDI. */
  504.  
  505. /*      New additions. */
  506.  
  507.     long (*audioclick)();               /* Play click sound. */
  508.  
  509.     struct Track *selectedtrack;        /* Track currently selected. */
  510.  
  511.     long flags;                         /* Additional flags. */
  512.     long pad[74];                       /* Room for more. */
  513.  
  514.     long (*installtransportp)();        /* Install prioritized transport handler. */
  515.  
  516.     long (*fastgets)();                 /* fgets() */
  517.     long (*fastseek)();                 /* Fast seek file io. */
  518.  
  519.     void (*adddisplayserver)();
  520.     void (*removedisplayserver)();
  521.  
  522.     long (*dragtool)();
  523.     void (*addtoolserver)();            /* Server for dragging tools. */
  524.     void (*removetoolserver)();
  525.  
  526.     long (*editsysex)();                /* Open sysex requester. */
  527.     struct Event *(*dupeevent)();       /* Duplicate an event. */
  528.  
  529.     long (*frametotime)();              /* Convert frame to time. */
  530.     long (*timetoframe)();              /* Convert time to frame. */
  531.     long (*frametohmsf)();              /* Convert frame to hmsf. */
  532.     long (*hirestotime)();              /* Hires clock to time. */
  533.     long (*timetohires)();              /* Time to hires. */
  534.     long (*hirestoframe)();             /* Hires clock to frame. */
  535.     long (*frametohires)();             /* Frame to hires clock. */
  536.  
  537.     long (*deletetool)();               /* Delete a tool. */
  538.     long (*createtool)();               /* Allocate a new tool. */
  539.     long (*sizetool)();                 /* Returns size prior to save. */
  540.     long (*savetool)();                 /* Save a Tool to disk. */
  541.     long (*loadtool)();                 /* Load a Tool from disk. */
  542.  
  543.     long (*gettoolmaster)();            /* Returns selected ToolMaster. */
  544.  
  545. /*      Old routines: */
  546.  
  547.     long (*processsmpteclock)();        /* Process a SMPTE event. */
  548.     long (*processmidiclock)();         /* Process a MIDI clock event .*/
  549.     long (*processsysex)();             /* Handle a sysex packet. */
  550.     long (*processinputevent)();        /* Process a PipeLine input event. */
  551.  
  552.     long (*clearenvironment)();         /* Clear the environment. */
  553.     long (*installenvironment)();       /* Replace the environment. */
  554.     long (*loadsong)();
  555.     long (*savesong)();
  556.  
  557.     long (*installtransport)();         /* Install transport handler. */
  558.     long (*removetransport)();          /* Remove transport handler. */
  559.     long (*transportcommand)();         /* Send command to handlers. */
  560.  
  561.     long (*qevent)();                   /* Put event in queue. */
  562.     long (*allocevent)();               /* Allocate an event. */
  563.     long (*fastallocevent)();           /* Allocate an event from interrupt. */
  564.     long (*freeevent)();                /* Free an event. */
  565.     long (*sorteventlist)();            /* Sort a list of events. */
  566.     long (*freelist)();                 /* Free a list of events. */
  567.     long (*dupelist)();                 /* Duplicate a list. */
  568.  
  569.     long (*allocstring)();              /* Allocate a string. */
  570.     long (*freestring)();               /* Free a string. */
  571.     long (*replacestring)();            /* Replace a string with another. */
  572.     long (*dupestring)();               /* Duplicate a string. */
  573.     long (*stringtext)();               /* Get string. */
  574.  
  575.     long (*clearclip)();                /* Clear a clip. */
  576.     long (*dupeclip)();                 /* Duplicate a clip. */
  577.     long (*cutclip)();                  /* Clip cut operation. */
  578.     long (*copyclip)();                 /* Clip copy operation. */
  579.     long (*pasteclip)();                /* Clip paste operation. */
  580.     long (*mixclip)();                  /* Clip mix operation. */
  581.     long (*loadclip)();                 /* Load a clip from disk. */
  582.     long (*saveclip)();                 /* Save a clip. */
  583.     long (*clipboard)();                /* Clipboard operation. */
  584.  
  585.     long (*createtrack)();              /* Create a track. */
  586.     long (*deletetrack)();              /* Delete a track. */
  587.  
  588.     long (*myalloc)();                  /* Internal allocation routine. */
  589.     long (*myfree)();                   /* Internal free routine. */
  590.  
  591.     long (*doscall)();                  /* Make a DOS command. */
  592.     long (*fastopen)();                 /* Fast file open. */
  593.     long (*fastwrite)();                /* Fast file write. */
  594.     long (*fastread)();                 /* Fast file read. */
  595.     long (*fastclose)();                /* Fast file close. */
  596.  
  597.     long (*popupkey)();
  598.     long (*popupnote)();
  599.     long (*popupoctave)();
  600.     long (*popupchord)();
  601.     long (*popuprhythm)();
  602.     long (*popupscale)();
  603.  
  604.     long (*measuretotime)();
  605.     long (*timetomeasure)();
  606.     long (*totalbeatstotime)();
  607.     long (*timetototalbeats)();
  608.     long (*lengthtostring)();
  609.     long (*stringtolength)();
  610.     long (*timetostring)();
  611.     long (*stringtotime)();
  612.     long (*frametostring)();
  613.     long (*stringtoframe)();
  614.     long (*notetostring)();
  615.     long (*stringtonote)();
  616.  
  617.     long (*noteinkey)();                /* Check for note in key. */
  618.     long (*noteinchord)();              /* Check for note in chord. */
  619.     long (*noteinrhythm)();             /* Align note with rhythm. */
  620.     long (*timetokey)();
  621.     long (*timetochord)();
  622.     long (*timetodynamics)();
  623.     long (*nextrhythmbeat)();
  624.     long (*scaletotwelve)();
  625.     long (*twelvetoscale)();
  626.     long (*random)();                   /* Return random number. */
  627.  
  628.     long (*areyousure)();               /* Put up "are you sure?" requester. */
  629.     long (*openwait)();                 /* Open wait requester. */
  630.     long (*closewait)();                /* Close wait requester. */
  631.  
  632.     long (*display)();                  /* Display main window. */
  633.     long (*ScrollingPopUpMenu)();
  634.     long (*DragSlider)();
  635.     long (*DrawSlider)();
  636. /*      Inovatools 1 routines. */
  637.     long (*Itoa)();
  638.     long (*Atoi)();
  639.     long (*RefreshGadget)();
  640.     long (*GetGadget)();
  641.     long (*GetStringInfo)();
  642.     long (*SetStringInfo)();
  643.     long (*GetStringInfoNumber)();
  644.     long (*SetStringInfoNumber)();
  645.     long (*GetPropInfo)();
  646.     long (*SetPropInfo)();
  647.     long (*GetSelectIntuiMessage)();
  648.     long (*GetIntuiMessage)();
  649.     long (*ClearIntuiMessages)();
  650.     long (*GetMenu)();
  651.     long (*GetMenuItem)();
  652.     long (*CheckMenuItem)();
  653.     long (*EnableMenuItem)();
  654.     long (*EnableMenu)();
  655.     long (*EnableGadget)();
  656.     long (*SelectGadget)();
  657.     long (*DupeNewWindow)();
  658.     long (*DeleteNewWindow)();
  659.     long (*DupeMenu)();
  660.     long (*DeleteMenu)();
  661.     long (*SendCloseWindow)();
  662.     long (*List_Len)();
  663.     long (*List_Position)();
  664.     long (*List_Pred)();
  665.     long (*List_Index)();
  666.     long (*List_Cat)();
  667.     long (*List_Insert)();
  668.     long (*List_Remove)();
  669.     long (*SetScrollBar)();
  670.     long (*DrawList)();
  671.     long (*ScrollList)();
  672.     long (*SizeList)();
  673.     long (*InitListInfo)();
  674.     long (*RemoveListInfo)();
  675.     long (*GetListItem)();
  676.     long (*ClickList)();
  677.     long (*InsertListItem)();
  678.     long (*RemoveListItem)();
  679.     long (*PopUpMenu)();
  680.     long (*DragGadget)();
  681.     long (*FileName)();
  682.     long (*FlashyOpenWindow)();
  683.     long (*FlashyCloseWindow)();
  684.     long (*WhichWindow)();
  685.     long (*DupeListInfo)();
  686.     long (*DeleteListInfo)();
  687.     long (*RealTimeScroll)();
  688.     void (*EmbossOn)(struct Window *,short ,short );
  689.     void (*EmbossOff)(struct Window *,short );
  690.     void (*DrawEmbossed)(struct Window *,short );
  691.     void (*EnableEmbossed)(struct Window *,short ,short );
  692.     void (*SelectEmbossed)(struct Window *,short ,short );
  693.     void (*ModifyEmbossedProp)(struct Window *,short,long,long,long,long,long,long);
  694.     long (*DragEmbossedProp)(struct Window *,short );
  695.     long (*DrawEmbossedProp)(struct Window *,short );
  696.     long (*ShiftEmbossedPropOnce)(struct Window *,short,short,short );
  697.     long (*ShiftEmbossedProp)(struct Window *,short,short ,short );
  698.     long (*EmbossedPropOn)(struct Window *,short,long (*)(void),unsigned short ,
  699.      unsigned short );
  700.     void (*FatEmbossedPropOn)(struct Window *,short ,short ,short ,
  701.     long (*)(void),unsigned short ,char );
  702.     void (*EmbossedPropOff)(struct Window *,short );
  703.     void (*FatEmbossedPropOff)(struct Window *,short ,short ,short );
  704.     void (*DrawEmbossedRect)(struct RastPort *,short ,short ,short ,short ,short );
  705.     void (*DrawEmbossedWindow)(struct Window *,short );
  706.     void (*EmbossWindowOff)(struct Window *);
  707.     void (*EmbossWindowOn)(struct Window *,
  708.     long ,char *,unsigned short ,unsigned short ,long (*)(void),long (*)(void));
  709.     void (*EmbossRequestOn)(struct Window *,char *);
  710.     void (*RefreshEmbossedWindowFrame)(struct Window *);
  711.     int (*SystemGadgets)(struct Window *,long ,struct Gadget *,long);
  712.     void (*ModifyWindowProps)(struct Window *,unsigned long ,unsigned long ,
  713.     unsigned long ,unsigned long ,unsigned long ,unsigned long );
  714.     void (*EmbossedWindowTitle)(struct Window *,char *);
  715.     void (*EmbossedWindowText)(struct Window *,char *,short );
  716. };
  717.  
  718. /* Media Madness Flags */
  719.  
  720. #define MMCMD_COPYALLFILES      0x0001  /* pass the path name to copy to */
  721. #define MMCMD_INSTALLHITLIST    0x0002  /* no parameters */
  722. #define MMCMD_CONVERTTOHIRES    0x0003  /* no parameters */
  723. #define MMCMD_CONVERTFROMHIRES  0x0004  /* no parameters */
  724.  
  725.  
  726. #define HITNAMESIZE   30
  727.  
  728.   struct HitName {
  729.       struct HitName *next;             /* Linked list. */
  730.       unsigned char note;               /* Equivalent MIDI value. */
  731.       char name[HITNAMESIZE];           /* Text. */
  732.   };
  733.  
  734.   typedef struct PatchNames {
  735.       struct PatchNames *next;          /* Next in list. */
  736.       char name[20];                    /* Name of list. */
  737.       short usecount;                   /* # of tools using this. */
  738.       unsigned char names[128][14];     /* Array of names. */
  739.   } PatchNames;
  740.